#include "lan2calbutton.h"
#include "lan2calcontrol.h"
LAN2STA
Lan2CalControl::Lan2CalControl(QWidget *parent,int width, int height ) : QWidget(parent)
{

    this->setAttribute(Qt::WA_StyledBackground);
    this->setStyleSheet("background:#fdfdfd");

    this->setFixedSize(width,height);


    hbox=new QHBoxLayout();
    hbox->setSpacing(0);
    hbox->setMargin(0);
    hbox->setContentsMargins(2,2,2,2);

    this->setLayout(hbox);
    Lan2CalButton* btn_today=new Lan2CalButton(this,"今天");
    Lan2CalButton* btn_clear=new Lan2CalButton(this,"隐藏");
    Lan2CalButton* btn_ok=new Lan2CalButton(this,"确定");
    Lan2CalButton* btn_tostart=new Lan2CalButton(this,"标准开始");
    Lan2CalButton* btn_toend=new Lan2CalButton(this,"标准结束");
//    Lan2CalButton* btn_toall=new Lan2CalButton(this,"标准时间");
    connect(btn_today,SIGNAL(clicked(bool)),this,SLOT(slot_today()));
    connect(btn_clear,SIGNAL(clicked(bool)),this,SLOT(slot_clear()));
    connect(btn_ok,SIGNAL(clicked(bool)),this,SLOT(slot_ok()));
    connect(btn_tostart,SIGNAL(clicked(bool)),this,SLOT(slot_tostart()));
    connect(btn_toend,SIGNAL(clicked(bool)),this,SLOT(slot_toend()));
//    connect(btn_toall,SIGNAL(clicked(bool)),this,SLOT(slot_toall()));



    hbox->addSpacing(5);
    hbox->addWidget(btn_today);
    hbox->addStretch();
    hbox->addWidget(btn_tostart);
    hbox->addSpacing(5);
    hbox->addWidget(btn_toend);
//    hbox->addSpacing(5);
//    hbox->addWidget(btn_toall);
    hbox->addSpacing(5);
    hbox->addWidget(btn_clear);
    hbox->addSpacing(5);
    hbox->addWidget(btn_ok);
    hbox->addSpacing(5);



}

void Lan2CalControl::slot_today()
{
    emit sign_today();
}

void Lan2CalControl::slot_clear()
{
    emit sign_clear();
}

void Lan2CalControl::slot_ok()
{
    emit sign_ok();
}

void Lan2CalControl::slot_tostart()
{
   emit sign_tostart();
}

void Lan2CalControl::slot_toend()
{
    emit sign_toend();
}

void Lan2CalControl::slot_toall()
{
    emit sign_toall();
}

LAN2END
